package org.example.controller;

import org.example.pojo.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/boot")
public class TestController {
    @Autowired
    private Car car;

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @GetMapping("/getCar")
    public Car getCar() {
        return car;
    }

    @GetMapping("/count")
    public void testCount() {
        Long aLong = jdbcTemplate.queryForObject("select count(*) from test_enum",
                Long.class);
        System.out.println(aLong);
    }
}
